#include "def.h"
#include "io_sock.h"


int main(int argc, char **argv)
{
	printf("log_client test:\n");
	sock_t sock;
	if (sock_init(&sock, ">tcp:127.0.0.1:8001") < 0) {
		ERR("sock_init fail");
		return -1;
	}
	sock_tostring(&sock);

	char *str = "log info for test\n";
	while (1) {
		size_t len = strlen(str);
		if (sock_send(&sock, str, len) < len) {
			ERR("sock_send fail");
			break;
		}

		sleep(1);
	}

	sock_term(&sock);
	return 0;
}
